﻿/*
=============================================================================
Author:魏宝辉通过CodeSmithe生成
CreatedTime:2012-12-12
Description:BPM_IPWhiteList三层结构数据访问层
=============================================================================
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using PWMIS.DataMap.Entity;
using FTchina.Models;//引入模型层
namespace FTchina.DAL
{
	public static partial class BPM_IPWhiteListService
	{
		 
	 
			
		public static int DeleteBPM_IPWhiteListById(long id)	
		{     
            BPM_IPWhiteList bPM_IPWhiteList = new BPM_IPWhiteList();
            bPM_IPWhiteList.Id = id;
            EntityQuery<BPM_IPWhiteList> query = new EntityQuery<BPM_IPWhiteList>(bPM_IPWhiteList);
             return query.Delete(bPM_IPWhiteList);
		}	
        
          //以标识列获得对象
        public static BPM_IPWhiteList GetBPM_IPWhiteListById(long  id)
        {
            BPM_IPWhiteList bPM_IPWhiteList = new BPM_IPWhiteList();
            bPM_IPWhiteList.Id = id;
            EntityQuery<BPM_IPWhiteList> query = new EntityQuery<BPM_IPWhiteList>(bPM_IPWhiteList);
            query.FillEntity(bPM_IPWhiteList);
            return bPM_IPWhiteList;
        }
		
	 
	 
       
        
        
        
		 
		 
		 public static int AddOrUpdateBPM_IPWhiteList(BPM_IPWhiteList bPM_IPWhiteList)
        {
            BPM_IPWhiteList _bPM_IPWhiteList = new BPM_IPWhiteList();

            EntityQuery<BPM_IPWhiteList> query = new EntityQuery<BPM_IPWhiteList>(_bPM_IPWhiteList);
           _bPM_IPWhiteList= bPM_IPWhiteList;
           int i=(bPM_IPWhiteList.Id==0)?
                 query.Insert(_bPM_IPWhiteList): query.Update(_bPM_IPWhiteList);
            return i;
        }
		
		 
	}
}

